<?php

namespace App\Http\Controllers;


use App\Models\Student;
use Illuminate\Support\Facades\Request;


class DatebaseController extends Controller
{
    //
    public function index(Request $request )
    {

        $query = $request::query();

        $students = Student::list($query);

        $majors = $students->pluck('major')->unique();

        return view('database',['user'=>$students,'majors'=>$majors,'form'=>$query]); // 返回 hello.blade.php 视图;
    }

    public function insert()
    {
        $student = new Student();


    }





}
